﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Usuários
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <h2>Usuários</h2>
    <table>
        <tr>
            <td>
                <input type="button" value="Novo" onclick="document.location.href='<%: Url.Action("Create", new { id = 0 }) %>'" />
            </td>
        </tr>
    </table>
    <table cellpadding="0" cellspacing="0" width="90%">
        <tr>
            <th>Login</th>
            <th>Nome</th>
            <th>Email</th>
            <th>Obs.</th>
            <th style="text-align: center;">Status</th>
            <th style="text-align: center;">Editar</th>
        </tr>
        <% int i = 0; %>
        <% foreach (var item in Model) { %>
        <tr class='<%= i % 2 == 0 ? "gridrow" : "gridalt" %>'>
            <td><%=  Html.Encode(item.UserName) %></td>
            <td><%=  Html.Encode(item.Name) %></td>
            <td><%= Html.Encode(item.Email) %></td>
            <td><%= Html.Encode(item.Notes) %></td>
            <td style="text-align: center;"><%= Html.Encode(item.IsLockedOut ? "Bloqueado" : "Desbloqueado") %></td>
            <td style="text-align: center;">
                <a href="<%= Url.Action("Edit", new { id = item.LoginId }) %>" title="Editar">
                    <img src="<%: Url.Content("~/Content/Images/Pen.gif")%>" style="border: none 0px;" alt="Editar" /></a>
            </td>
        </tr>
        <% i++; %>
        <% } %>
    </table>
</asp:Content>
